﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Tsual.Wechat.Pipes;

namespace Tsual.Datapipeline.All.AspCore.Test.Controllers
{
    public class HomeController : Controller
    {

        public IActionResult Index()
        {
            return Content("123");
        }
    }

    [Route("test")]
    public class TestController:Controller
    {
        PmouldWechatCore mould;

        public TestController(PmouldWechatCore mould)
        {
            this.mould = mould ?? throw new ArgumentNullException(nameof(mould));
        }

        [HttpGet]
        public async Task<object> actionResultAsync()
        {
            return await mould.AccessToken.ReadAsync(DpmmAccessToken.Instance);
        }
    }
}
